Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix scope hoisting #152

Merged
merged 4 commits into from
May 22, 2018
Merged

Fix scope hoisting #152

merged 4 commits into from
May 22, 2018

Conversation

bugzpodder
Copy link
Contributor

@bugzpodder bugzpodder commented May 22, 2018

Issues: #151 facebook/create-react-app#4492

Same as
#117
with a test case.


fix #151
closes #117

@codecov-io
Copy link

codecov-io commented May 22, 2018

Codecov Report

Merging #152 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #152   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           3      3           
  Lines         110    111    +1     
  Branches       21     22    +1     
=====================================
+ Hits          110    111    +1
Impacted Files Coverage Δ
lib/plugin.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95d94ef...b9d5ef1. Read the comment docs.

const plugins = [
new ManifestPlugin(),
];
if (webpack.optimize.ModuleConcatenationPlugin) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use isWebpack4() so it's easy to refactor out once we drop webpack < 4


describe('scoped hoisting', function() {
var compiler;
var hashes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that's needed

});

afterAll(() => {
compiler.close()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I expect you only need that only on watch mode, no?

],
},
output: {
filename: '[name].[hash].js',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it add value to add the hash?

@@ -22,8 +22,10 @@
"file-loader": "^1.1.11",
"jest": "^22.4.3",
"memory-fs": "^0.2.0",
"react": "^16.3.2",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it being used anywhere, is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's needed because svgr converts the svg file to a react component.

Copy link
Contributor

@mastilver mastilver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for that! :)

Can you check the few comments I've left

@bugzpodder
Copy link
Contributor Author

Thanks for the super fast review! If you get a chance to do a release after you merge this PR that would be doubly awesome! gaearon is asking for this as a follow up for CRA 2.0's webpack 4 support :)

it('outputs a manifest', function(done) {
let plugins;
if (webpack.optimize.ModuleConcatenationPlugin) {
// ModuleConcatenationPlugin works with webpack 3, 4.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha, my bad :)

@mastilver mastilver merged commit 5dca486 into shellscape:master May 22, 2018
@mastilver
Copy link
Contributor

mastilver commented May 22, 2018

v2.0.3 released :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scope hoisting webpack 4
3 participants